package com.telecom.restaurant.dao;

import com.telecom.restaurant.model.OrderPO;
import com.telecom.restaurant.model.param.OrderSearchParam;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface OrderDao {

    int insert(OrderPO record);

    OrderPO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(OrderPO record);

    List<OrderPO> searchOrder(OrderSearchParam param);

    int count(OrderSearchParam param);

    int batchPickFood(@Param("orderIdList") List<Long> orderIds, @Param("status") Integer status);

    OrderPO getCancelOrderInfo(Long orderId);

    int updateOrderStatus(@Param("id") Long orderId,
                          @Param("newStatus") Integer newStatus,
                          @Param("lastStatus") Integer lastStatus);

    int batchUpdateOrderStatus(@Param("orderIdList") List<Long> orderIdList,
                               @Param("newStatus") Integer newStatus,
                               @Param("lastStatus") Integer lastStatus);
}